#!/bin/bash
path=`cd \`dirname $0\`;cd ../output;pwd`
releast_file=`ls -lrt ${path}/*.zip | tail -1 | awk -F " " '{print $9}'`

#rename file name

if [  -f $releast_file ];then
   mv $releast_file $path/ROOT.war
fi;

srcfile=$path/ROOT.war

if [ -f $srcfile  ];then
  echo "$srcfile";
else
  echo "$srcfile not exist";
  exit 1;
fi;

#mv $releast_file $path/ROOT.war

confpath=`cd \`dirname $0\`;pwd`
echo $confpath
source $confpath/server.conf

source $server_file

vpnpath=/Users/luoyouhua/Documents/tool/vpn
echo "$vpnpath/expect_scp $user $host $port $password $srcfile $destfile"
#echo "$path/expect $user $host $port $password"
$vpnpath/expect_scp $user $host $port $password $srcfile $destfile
